#!/bin/sh
#
# dotar -- written by Alexis WILKE (c) 2005-2006
#
#######################################################################
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#######################################################################

# This script creates packages

VERSION=`grep "AC_INIT" configure.ac | sed -e 's/.*\[\([0-9]\.[0-9]\+\)\].*/\1/'`
PACKAGES=../packages
if test -d $PACKAGES/apple_emulator-$VERSION
then
	echo "Package: $PACKAGES/apple_emulator-$VERSION"
	echo
	echo "This package directory already exists. Please, delete and"
	echo "try again if you want to re-generate this package."
	exit 1;
fi
mkdir -p $PACKAGES/apple_emulator-$VERSION
rm -rf apple_emulator-$VERSION
mkdir -p apple_emulator-$VERSION
cp -rf computer doc cpu include basic-programs build \
	config.guess config.h.in config.sub \
	configure* depcomp install-sh ltmain.sh Makefile.am Makefile.in \
	missing aclocal.m4 sendall dotar \
			apple_emulator-$VERSION
tar czf $PACKAGES/apple_emulator-$VERSION/apple_emulator-$VERSION-src.tar.gz apple_emulator-$VERSION

echo "Package: \"$PACKAGES/apple_emulator-$VERSION/apple_emulator-$VERSION-src.tar.gz\" done."

